home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / MacMemory.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  33.3 KB  |  920 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        MacMemory.h
  3.  
  4.      Contains:    Memory Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 8.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1985-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __MACMEMORY__
  18. #define __MACMEMORY__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __MIXEDMODE__
  25.     #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. enum {
  52.     maxSize                        = 0x7FFFFFF0                    /*the largest block possible*/
  53. };
  54.  
  55. enum {
  56.     defaultPhysicalEntryCount    = 8
  57. };
  58.  
  59. enum {
  60.                                                                 /* values returned from the GetPageState function */
  61.     kPageInMemory                = 0,
  62.     kPageOnDisk                    = 1,
  63.     kNotPaged                    = 2
  64. };
  65.  
  66. enum {
  67.                                                                 /* masks for Zone->heapType field */
  68.     k32BitHeap                    = 1,                            /* valid in all Memory Managers */
  69.     kNewStyleHeap                = 2,                            /* true if new Heap Manager is present */
  70.     kNewDebugHeap                = 4                                /* true if new Heap Manager is running in debug mode on this heap */
  71. };
  72.  
  73. /* Note: The type "Size" moved to Types.h */
  74.  
  75.  
  76. typedef CALLBACK_API( long , GrowZoneProcPtr )(Size cbNeeded);
  77. typedef CALLBACK_API( void , PurgeProcPtr )(Handle blockToPurge);
  78. typedef CALLBACK_API( void , UserFnProcPtr )(void *parameter);
  79. /*
  80.     WARNING: UserFnProcPtr uses register based parameters under classic 68k
  81.              and cannot be written in a high-level language without 
  82.              the help of mixed mode or assembly glue.
  83. */
  84. typedef STACK_UPP_TYPE(GrowZoneProcPtr)                         GrowZoneUPP;
  85. typedef STACK_UPP_TYPE(PurgeProcPtr)                             PurgeUPP;
  86. typedef REGISTER_UPP_TYPE(UserFnProcPtr)                         UserFnUPP;
  87.  
  88. struct Zone {
  89.     Ptr                             bkLim;
  90.     Ptr                             purgePtr;
  91.     Ptr                             hFstFree;
  92.     long                             zcbFree;
  93.     GrowZoneUPP                     gzProc;
  94.     short                             moreMast;
  95.     short                             flags;
  96.     short                             cntRel;
  97.     short                             maxRel;
  98.     short                             cntNRel;
  99.     SInt8                             heapType;                    /* previously "maxNRel", now holds flags (e.g. k32BitHeap)*/
  100.     SInt8                             unused;
  101.     short                             cntEmpty;
  102.     short                             cntHandles;
  103.     long                             minCBFree;
  104.     PurgeUPP                         purgeProc;
  105.     Ptr                             sparePtr;
  106.     Ptr                             allocPtr;
  107.     short                             heapData;
  108. };
  109. typedef struct Zone                        Zone;
  110.  
  111. typedef Zone *                            THz;
  112.  
  113. struct MemoryBlock {
  114.     void *                            address;
  115.     unsigned long                     count;
  116. };
  117. typedef struct MemoryBlock                MemoryBlock;
  118.  
  119. struct LogicalToPhysicalTable {
  120.     MemoryBlock                     logical;
  121.     MemoryBlock                     physical[8];
  122. };
  123. typedef struct LogicalToPhysicalTable    LogicalToPhysicalTable;
  124.  
  125. typedef short                             PageState;
  126. typedef short                             StatusRegisterContents;
  127. enum {
  128.     kVolumeVirtualMemoryInfoVersion1 = 1                        /* first version of VolumeVirtualMemoryInfo*/
  129. };
  130.  
  131.  
  132. struct VolumeVirtualMemoryInfo {
  133.     PBVersion                         version;                    /* Input: Version of the VolumeVirtualMemoryInfo structure*/
  134.     SInt16                             volumeRefNum;                /* Input: volume reference number*/
  135.     Boolean                         inUse;                        /* output: true if volume is currently used for file mapping*/
  136.     UInt8                             _fill;
  137.     UInt32                             vmOptions;                    /* output: tells what volume can support (same as DriverGestaltVMOptionsResponse vmOptions bits in DriverGestalt)*/
  138.                                                                 /* end of kVolumeVirtualMemoryInfoVersion1 structure*/
  139. };
  140. typedef struct VolumeVirtualMemoryInfo    VolumeVirtualMemoryInfo;
  141. typedef VolumeVirtualMemoryInfo *        VolumeVirtualMemoryInfoPtr;
  142. #if OPAQUE_UPP_TYPES
  143.     EXTERN_API(GrowZoneUPP)
  144.     NewGrowZoneUPP                   (GrowZoneProcPtr            userRoutine);
  145.  
  146.     EXTERN_API(PurgeUPP)
  147.     NewPurgeUPP                       (PurgeProcPtr            userRoutine);
  148.  
  149.     EXTERN_API(UserFnUPP)
  150.     NewUserFnUPP                   (UserFnProcPtr            userRoutine);
  151.  
  152.     EXTERN_API(void)
  153.     DisposeGrowZoneUPP               (GrowZoneUPP                userUPP);
  154.  
  155.     EXTERN_API(void)
  156.     DisposePurgeUPP                   (PurgeUPP                userUPP);
  157.  
  158.     EXTERN_API(void)
  159.     DisposeUserFnUPP               (UserFnUPP                userUPP);
  160.  
  161.     EXTERN_API(long)
  162.     InvokeGrowZoneUPP               (Size                    cbNeeded,
  163.                                     GrowZoneUPP                userUPP);
  164.  
  165.     EXTERN_API(void)
  166.     InvokePurgeUPP                   (Handle                    blockToPurge,
  167.                                     PurgeUPP                userUPP);
  168.  
  169.     EXTERN_API(void)
  170.     InvokeUserFnUPP                   (void *                    parameter,
  171.                                     UserFnUPP                userUPP);
  172.  
  173. #else
  174.     enum { uppGrowZoneProcInfo = 0x000000F0 };                         /* pascal 4_bytes Func(4_bytes) */
  175.     enum { uppPurgeProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  176.     enum { uppUserFnProcInfo = 0x00009802 };                         /* register no_return_value Func(4_bytes:A0) */
  177.     #define NewGrowZoneUPP(userRoutine)                             (GrowZoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
  178.     #define NewPurgeUPP(userRoutine)                                 (PurgeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture())
  179.     #define NewUserFnUPP(userRoutine)                                 (UserFnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture())
  180.     #define DisposeGrowZoneUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  181.     #define DisposePurgeUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  182.     #define DisposeUserFnUPP(userUPP)                                 DisposeRoutineDescriptor(userUPP)
  183.     #define InvokeGrowZoneUPP(cbNeeded, userUPP)                     (long)CALL_ONE_PARAMETER_UPP((userUPP), uppGrowZoneProcInfo, (cbNeeded))
  184.     #define InvokePurgeUPP(blockToPurge, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppPurgeProcInfo, (blockToPurge))
  185.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  186.     #pragma parameter InvokeUserFnUPP(__A0, __A1)
  187.     void InvokeUserFnUPP(void * parameter, UserFnUPP userUPP) = 0x4E91;
  188.     #else
  189.         #define InvokeUserFnUPP(parameter, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppUserFnProcInfo, (parameter))
  190.     #endif
  191. #endif
  192. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  193. #define NewGrowZoneProc(userRoutine)                             NewGrowZoneUPP(userRoutine)
  194. #define NewPurgeProc(userRoutine)                                 NewPurgeUPP(userRoutine)
  195. #define NewUserFnProc(userRoutine)                                 NewUserFnUPP(userRoutine)
  196. #define CallGrowZoneProc(userRoutine, cbNeeded)                    InvokeGrowZoneUPP(cbNeeded, userRoutine)
  197. #define CallPurgeProc(userRoutine, blockToPurge)                InvokePurgeUPP(blockToPurge, userRoutine)
  198. #define CallUserFnProc(userRoutine, parameter)                    InvokeUserFnUPP(parameter, userRoutine)
  199. EXTERN_API( Ptr )
  200. GetApplLimit                    (void)                                                        TWOWORDINLINE(0x2EB8, 0x0130);
  201.  
  202. EXTERN_API( THz )
  203. SystemZone                        (void)                                                        TWOWORDINLINE(0x2EB8, 0x02A6);
  204.  
  205. EXTERN_API( THz )
  206. ApplicationZone                    (void)                                                        TWOWORDINLINE(0x2EB8, 0x02AA);
  207.  
  208. EXTERN_API( Handle )
  209. GZSaveHnd                        (void)                                                        TWOWORDINLINE(0x2EB8, 0x0328);
  210.  
  211. EXTERN_API( Ptr )
  212. TopMem                            (void)                                                        TWOWORDINLINE(0x2EB8, 0x0108);
  213.  
  214. EXTERN_API( OSErr )
  215. MemError                        (void)                                                        TWOWORDINLINE(0x3EB8, 0x0220);
  216.  
  217.  
  218.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  219.                                                                                             #pragma parameter __A0 GetZone
  220.                                                                                             #endif
  221. EXTERN_API( THz )
  222. GetZone                            (void)                                                        ONEWORDINLINE(0xA11A);
  223.  
  224.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  225.                                                                                             #pragma parameter __A0 NewHandle(__D0)
  226.                                                                                             #endif
  227. EXTERN_API( Handle )
  228. NewHandle                        (Size                     byteCount)                            ONEWORDINLINE(0xA122);
  229.  
  230.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  231.                                                                                             #pragma parameter __A0 NewHandleSys(__D0)
  232.                                                                                             #endif
  233. EXTERN_API( Handle )
  234. NewHandleSys                    (Size                     byteCount)                            ONEWORDINLINE(0xA522);
  235.  
  236.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  237.                                                                                             #pragma parameter __A0 NewHandleClear(__D0)
  238.                                                                                             #endif
  239. EXTERN_API( Handle )
  240. NewHandleClear                    (Size                     byteCount)                            ONEWORDINLINE(0xA322);
  241.  
  242.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  243.                                                                                             #pragma parameter __A0 NewHandleSysClear(__D0)
  244.                                                                                             #endif
  245. EXTERN_API( Handle )
  246. NewHandleSysClear                (Size                     byteCount)                            ONEWORDINLINE(0xA722);
  247.  
  248.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  249.                                                                                             #pragma parameter __A0 HandleZone(__A0)
  250.                                                                                             #endif
  251. EXTERN_API( THz )
  252. HandleZone                        (Handle                 h)                                    ONEWORDINLINE(0xA126);
  253.  
  254.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  255.                                                                                             #pragma parameter __A0 RecoverHandle(__A0)
  256.                                                                                             #endif
  257. EXTERN_API( Handle )
  258. RecoverHandle                    (Ptr                     p)                                    ONEWORDINLINE(0xA128);
  259.  
  260.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  261.                                                                                             #pragma parameter __A0 RecoverHandleSys(__A0)
  262.                                                                                             #endif
  263. EXTERN_API( Handle )
  264. RecoverHandleSys                (Ptr                     p)                                    ONEWORDINLINE(0xA528);
  265.  
  266.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  267.                                                                                             #pragma parameter __A0 NewPtr(__D0)
  268.                                                                                             #endif
  269. EXTERN_API( Ptr )
  270. NewPtr                            (Size                     byteCount)                            ONEWORDINLINE(0xA11E);
  271.  
  272.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  273.                                                                                             #pragma parameter __A0 NewPtrSys(__D0)
  274.                                                                                             #endif
  275. EXTERN_API( Ptr )
  276. NewPtrSys                        (Size                     byteCount)                            ONEWORDINLINE(0xA51E);
  277.  
  278.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  279.                                                                                             #pragma parameter __A0 NewPtrClear(__D0)
  280.                                                                                             #endif
  281. EXTERN_API( Ptr )
  282. NewPtrClear                        (Size                     byteCount)                            ONEWORDINLINE(0xA31E);
  283.  
  284.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  285.                                                                                             #pragma parameter __A0 NewPtrSysClear(__D0)
  286.                                                                                             #endif
  287. EXTERN_API( Ptr )
  288. NewPtrSysClear                    (Size                     byteCount)                            ONEWORDINLINE(0xA71E);
  289.  
  290.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  291.                                                                                             #pragma parameter __A0 PtrZone(__A0)
  292.                                                                                             #endif
  293. EXTERN_API( THz )
  294. PtrZone                            (Ptr                     p)                                    ONEWORDINLINE(0xA148);
  295.  
  296.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  297.                                                                                             #pragma parameter __D0 MaxBlock
  298.                                                                                             #endif
  299. EXTERN_API( long )
  300. MaxBlock                        (void)                                                        ONEWORDINLINE(0xA061);
  301.  
  302.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  303.                                                                                             #pragma parameter __D0 MaxBlockSys
  304.                                                                                             #endif
  305. EXTERN_API( long )
  306. MaxBlockSys                        (void)                                                        ONEWORDINLINE(0xA461);
  307.  
  308.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  309.                                                                                             #pragma parameter __D0 StackSpace
  310.                                                                                             #endif
  311. EXTERN_API( long )
  312. StackSpace                        (void)                                                        ONEWORDINLINE(0xA065);
  313.  
  314.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  315.                                                                                             #pragma parameter __A0 NewEmptyHandle
  316.                                                                                             #endif
  317. EXTERN_API( Handle )
  318. NewEmptyHandle                    (void)                                                        ONEWORDINLINE(0xA166);
  319.  
  320.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  321.                                                                                             #pragma parameter __A0 NewEmptyHandleSys
  322.                                                                                             #endif
  323. EXTERN_API( Handle )
  324. NewEmptyHandleSys                (void)                                                        ONEWORDINLINE(0xA566);
  325.  
  326.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  327.                                                                                             #pragma parameter HLock(__A0)
  328.                                                                                             #endif
  329. EXTERN_API( void )
  330. HLock                            (Handle                 h)                                    ONEWORDINLINE(0xA029);
  331.  
  332.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  333.                                                                                             #pragma parameter HUnlock(__A0)
  334.                                                                                             #endif
  335. EXTERN_API( void )
  336. HUnlock                            (Handle                 h)                                    ONEWORDINLINE(0xA02A);
  337.  
  338.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  339.                                                                                             #pragma parameter HPurge(__A0)
  340.                                                                                             #endif
  341. EXTERN_API( void )
  342. HPurge                            (Handle                 h)                                    ONEWORDINLINE(0xA049);
  343.  
  344.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  345.                                                                                             #pragma parameter HNoPurge(__A0)
  346.                                                                                             #endif
  347. EXTERN_API( void )
  348. HNoPurge                        (Handle                 h)                                    ONEWORDINLINE(0xA04A);
  349.  
  350.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  351.                                                                                             #pragma parameter HLockHi(__A0)
  352.                                                                                             #endif
  353. EXTERN_API( void )
  354. HLockHi                            (Handle                 h)                                    TWOWORDINLINE(0xA064, 0xA029);
  355.  
  356. EXTERN_API( Handle )
  357. TempNewHandle                    (Size                     logicalSize,
  358.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001D, 0xA88F);
  359.  
  360. EXTERN_API( Size )
  361. TempMaxMem                        (Size *                    grow)                                THREEWORDINLINE(0x3F3C, 0x0015, 0xA88F);
  362.  
  363. EXTERN_API( long )
  364. TempFreeMem                        (void)                                                        THREEWORDINLINE(0x3F3C, 0x0018, 0xA88F);
  365.  
  366. EXTERN_API( void )
  367. InitZone                        (GrowZoneUPP             pgrowZone,
  368.                                  short                     cmoreMasters,
  369.                                  void *                    limitPtr,
  370.                                  void *                    startPtr);
  371.  
  372.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  373.                                                                                             #pragma parameter SetZone(__A0)
  374.                                                                                             #endif
  375. EXTERN_API( void )
  376. SetZone                            (THz                     hz)                                    ONEWORDINLINE(0xA01B);
  377.  
  378.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  379.                                                                                             #pragma parameter __D0 CompactMem(__D0)
  380.                                                                                             #endif
  381. EXTERN_API( Size )
  382. CompactMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA04C);
  383.  
  384.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  385.                                                                                             #pragma parameter __D0 CompactMemSys(__D0)
  386.                                                                                             #endif
  387. EXTERN_API( Size )
  388. CompactMemSys                    (Size                     cbNeeded)                            ONEWORDINLINE(0xA44C);
  389.  
  390.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  391.                                                                                             #pragma parameter PurgeMem(__D0)
  392.                                                                                             #endif
  393. EXTERN_API( void )
  394. PurgeMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA04D);
  395.  
  396.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  397.                                                                                             #pragma parameter PurgeMemSys(__D0)
  398.                                                                                             #endif
  399. EXTERN_API( void )
  400. PurgeMemSys                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA44D);
  401.  
  402.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  403.                                                                                             #pragma parameter __D0 FreeMem
  404.                                                                                             #endif
  405. EXTERN_API( long )
  406. FreeMem                            (void)                                                        ONEWORDINLINE(0xA01C);
  407.  
  408.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  409.                                                                                             #pragma parameter __D0 FreeMemSys
  410.                                                                                             #endif
  411. EXTERN_API( long )
  412. FreeMemSys                        (void)                                                        ONEWORDINLINE(0xA41C);
  413.  
  414.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  415.                                                                                             #pragma parameter ReserveMem(__D0)
  416.                                                                                             #endif
  417. EXTERN_API( void )
  418. ReserveMem                        (Size                     cbNeeded)                            ONEWORDINLINE(0xA040);
  419.  
  420.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  421.                                                                                             #pragma parameter ReserveMemSys(__D0)
  422.                                                                                             #endif
  423. EXTERN_API( void )
  424. ReserveMemSys                    (Size                     cbNeeded)                            ONEWORDINLINE(0xA440);
  425.  
  426.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  427.                                                                                             #pragma parameter __D0 MaxMem(__A1)
  428.                                                                                             #endif
  429. EXTERN_API( Size )
  430. MaxMem                            (Size *                    grow)                                TWOWORDINLINE(0xA11D, 0x2288);
  431.  
  432.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  433.                                                                                             #pragma parameter __D0 MaxMemSys(__A1)
  434.                                                                                             #endif
  435. EXTERN_API( Size )
  436. MaxMemSys                        (Size *                    grow)                                TWOWORDINLINE(0xA51D, 0x2288);
  437.  
  438.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  439.                                                                                             #pragma parameter SetGrowZone(__A0)
  440.                                                                                             #endif
  441. EXTERN_API( void )
  442. SetGrowZone                        (GrowZoneUPP             growZone)                            ONEWORDINLINE(0xA04B);
  443.  
  444.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  445.                                                                                             #pragma parameter MoveHHi(__A0)
  446.                                                                                             #endif
  447. EXTERN_API( void )
  448. MoveHHi                            (Handle                 h)                                    ONEWORDINLINE(0xA064);
  449.  
  450.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  451.                                                                                             #pragma parameter DisposePtr(__A0)
  452.                                                                                             #endif
  453. EXTERN_API( void )
  454. DisposePtr                        (Ptr                     p)                                    ONEWORDINLINE(0xA01F);
  455.  
  456. EXTERN_API( Size )
  457. GetPtrSize                        (Ptr                     p);
  458.  
  459.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  460.                                                                                             #pragma parameter SetPtrSize(__A0, __D0)
  461.                                                                                             #endif
  462. EXTERN_API( void )
  463. SetPtrSize                        (Ptr                     p,
  464.                                  Size                     newSize)                            ONEWORDINLINE(0xA020);
  465.  
  466.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  467.                                                                                             #pragma parameter DisposeHandle(__A0)
  468.                                                                                             #endif
  469. EXTERN_API( void )
  470. DisposeHandle                    (Handle                 h)                                    ONEWORDINLINE(0xA023);
  471.  
  472.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  473.                                                                                             #pragma parameter SetHandleSize(__A0, __D0)
  474.                                                                                             #endif
  475. EXTERN_API( void )
  476. SetHandleSize                    (Handle                 h,
  477.                                  Size                     newSize)                            ONEWORDINLINE(0xA024);
  478.  
  479. /* 
  480.     NOTE
  481.     
  482.     GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  483.     in case of an error, but the traps actually return an error code in D0.
  484.     The glue sets D0 to 0 if an error occurred.
  485. */
  486. EXTERN_API( Size )
  487. GetHandleSize                    (Handle                 h);
  488.  
  489.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  490.                                                                                             #pragma parameter __D0 InlineGetHandleSize(__A0)
  491.                                                                                             #endif
  492. EXTERN_API( Size )
  493. InlineGetHandleSize                (Handle                 h)                                    ONEWORDINLINE(0xA025);
  494.  
  495.  
  496. #if !TARGET_OS_MAC
  497. #define InlineGetHandleSize GetHandleSize
  498. #endif
  499.  
  500.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  501.                                                                                             #pragma parameter ReallocateHandle(__A0, __D0)
  502.                                                                                             #endif
  503. EXTERN_API( void )
  504. ReallocateHandle                (Handle                 h,
  505.                                  Size                     byteCount)                            ONEWORDINLINE(0xA027);
  506.  
  507.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  508.                                                                                             #pragma parameter ReallocateHandleSys(__A0, __D0)
  509.                                                                                             #endif
  510. EXTERN_API( void )
  511. ReallocateHandleSys                (Handle                 h,
  512.                                  Size                     byteCount)                            ONEWORDINLINE(0xA427);
  513.  
  514.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  515.                                                                                             #pragma parameter EmptyHandle(__A0)
  516.                                                                                             #endif
  517. EXTERN_API( void )
  518. EmptyHandle                        (Handle                 h)                                    ONEWORDINLINE(0xA02B);
  519.  
  520.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  521.                                                                                             #pragma parameter HSetRBit(__A0)
  522.                                                                                             #endif
  523. EXTERN_API( void )
  524. HSetRBit                        (Handle                 h)                                    ONEWORDINLINE(0xA067);
  525.  
  526.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  527.                                                                                             #pragma parameter HClrRBit(__A0)
  528.                                                                                             #endif
  529. EXTERN_API( void )
  530. HClrRBit                        (Handle                 h)                                    ONEWORDINLINE(0xA068);
  531.  
  532.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  533.                                                                                             #pragma parameter __D0 HGetState(__A0)
  534.                                                                                             #endif
  535. EXTERN_API( SInt8 )
  536. HGetState                        (Handle                 h)                                    ONEWORDINLINE(0xA069);
  537.  
  538.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  539.                                                                                             #pragma parameter HSetState(__A0, __D0)
  540.                                                                                             #endif
  541. EXTERN_API( void )
  542. HSetState                        (Handle                 h,
  543.                                  SInt8                     flags)                                ONEWORDINLINE(0xA06A);
  544.  
  545. EXTERN_API( void )
  546. PurgeSpace                        (long *                    total,
  547.                                  long *                    contig);
  548.  
  549. /*
  550.     PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  551.     on classic 68K.  The are the same as PurgeSpace() but return just
  552.     one value (either total space purgable or contiguous space purgable).
  553.     Begining in Mac OS 8.5 they are available in InterfaceLib.
  554. */
  555.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  556.                                                                                             #pragma parameter __A0 PurgeSpaceTotal
  557.                                                                                             #endif
  558. EXTERN_API( long )
  559. PurgeSpaceTotal                    (void)                                                        ONEWORDINLINE(0xA062);
  560.  
  561.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  562.                                                                                             #pragma parameter __D0 PurgeSpaceContiguous
  563.                                                                                             #endif
  564. EXTERN_API( long )
  565. PurgeSpaceContiguous            (void)                                                        ONEWORDINLINE(0xA062);
  566.  
  567.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  568.                                                                                             #pragma parameter __A0 PurgeSpaceSysTotal
  569.                                                                                             #endif
  570. EXTERN_API( long )
  571. PurgeSpaceSysTotal                (void)                                                        ONEWORDINLINE(0xA562);
  572.  
  573.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  574.                                                                                             #pragma parameter __D0 PurgeSpaceSysContiguous
  575.                                                                                             #endif
  576. EXTERN_API( long )
  577. PurgeSpaceSysContiguous            (void)                                                        ONEWORDINLINE(0xA562);
  578.  
  579.  
  580. /*****************************************************************************
  581.  
  582.     The routines: 
  583.  
  584.         BlockMoveUncached, BlockMoveDataUncached
  585.         BlockZero, BlockZeroUncached
  586.     
  587.     were first created for developers writing drivers. Originally they only
  588.     existed in DriverServicesLib.  Later they were added to InterfaceLib 
  589.     in PCI based PowerMacs.  MacOS 8.5 provides these routines in InterfaceLib
  590.     on all supported machines. 
  591.     
  592. *****************************************************************************/
  593.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  594.                                                                                             #pragma parameter BlockMove(__A0, __A1, __D0)
  595.                                                                                             #endif
  596. EXTERN_API( void )
  597. BlockMove                        (const void *            srcPtr,
  598.                                  void *                    destPtr,
  599.                                  Size                     byteCount)                            ONEWORDINLINE(0xA02E);
  600.  
  601.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  602.                                                                                             #pragma parameter BlockMoveData(__A0, __A1, __D0)
  603.                                                                                             #endif
  604. EXTERN_API( void )
  605. BlockMoveData                    (const void *            srcPtr,
  606.                                  void *                    destPtr,
  607.                                  Size                     byteCount)                            ONEWORDINLINE(0xA22E);
  608.  
  609. EXTERN_API_C( void )
  610. BlockMoveUncached                (const void *            srcPtr,
  611.                                  void *                    destPtr,
  612.                                  Size                     byteCount);
  613.  
  614. EXTERN_API_C( void )
  615. BlockMoveDataUncached            (const void *            srcPtr,
  616.                                  void *                    destPtr,
  617.                                  Size                     byteCount);
  618.  
  619. EXTERN_API_C( void )
  620. BlockZero                        (void *                    destPtr,
  621.                                  Size                     byteCount);
  622.  
  623. EXTERN_API_C( void )
  624. BlockZeroUncached                (void *                    destPtr,
  625.                                  Size                     byteCount);
  626.  
  627.  
  628. EXTERN_API( void )
  629. MaxApplZone                        (void)                                                        ONEWORDINLINE(0xA063);
  630.  
  631.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  632.                                                                                             #pragma parameter SetApplBase(__A0)
  633.                                                                                             #endif
  634. EXTERN_API( void )
  635. SetApplBase                        (void *                    startPtr)                            ONEWORDINLINE(0xA057);
  636.  
  637. EXTERN_API( void )
  638. MoreMasters                        (void)                                                        ONEWORDINLINE(0xA036);
  639.  
  640. #if TARGET_API_MAC_CARBON
  641. EXTERN_API_C( void )
  642. MoreMasterPointers                (UInt32                 inCount);
  643.  
  644. #endif  /* TARGET_API_MAC_CARBON */
  645.  
  646.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  647.                                                                                             #pragma parameter SetApplLimit(__A0)
  648.                                                                                             #endif
  649. EXTERN_API( void )
  650. SetApplLimit                    (void *                    zoneLimit)                            ONEWORDINLINE(0xA02D);
  651.  
  652. EXTERN_API( void )
  653. InitApplZone                    (void)                                                        ONEWORDINLINE(0xA02C);
  654.  
  655.  
  656. /*  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  */
  657. EXTERN_API( void )
  658. TempHLock                        (Handle                 h,
  659.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001E, 0xA88F);
  660.  
  661. EXTERN_API( void )
  662. TempHUnlock                        (Handle                 h,
  663.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x001F, 0xA88F);
  664.  
  665. EXTERN_API( void )
  666. TempDisposeHandle                (Handle                 h,
  667.                                  OSErr *                resultCode)                            THREEWORDINLINE(0x3F3C, 0x0020, 0xA88F);
  668.  
  669. EXTERN_API( Ptr )
  670. TempTopMem                        (void)                                                        THREEWORDINLINE(0x3F3C, 0x0016, 0xA88F);
  671.  
  672.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  673.                                                                                             #pragma parameter __D0 HoldMemory(__A0, __A1)
  674.                                                                                             #endif
  675. EXTERN_API( OSErr )
  676. HoldMemory                        (void *                    address,
  677.                                  unsigned long             count)                                TWOWORDINLINE(0x7000, 0xA05C);
  678.  
  679.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  680.                                                                                             #pragma parameter __D0 UnholdMemory(__A0, __A1)
  681.                                                                                             #endif
  682. EXTERN_API( OSErr )
  683. UnholdMemory                    (void *                    address,
  684.                                  unsigned long             count)                                TWOWORDINLINE(0x7001, 0xA05C);
  685.  
  686.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  687.                                                                                             #pragma parameter __D0 LockMemory(__A0, __A1)
  688.                                                                                             #endif
  689. EXTERN_API( OSErr )
  690. LockMemory                        (void *                    address,
  691.                                  unsigned long             count)                                TWOWORDINLINE(0x7002, 0xA05C);
  692.  
  693.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  694.                                                                                             #pragma parameter __D0 LockMemoryForOutput(__A0, __A1)
  695.                                                                                             #endif
  696. EXTERN_API( OSErr )
  697. LockMemoryForOutput                (void *                    address,
  698.                                  unsigned long             count)                                TWOWORDINLINE(0x700A, 0xA05C);
  699.  
  700.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  701.                                                                                             #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
  702.                                                                                             #endif
  703. EXTERN_API( OSErr )
  704. LockMemoryContiguous            (void *                    address,
  705.                                  unsigned long             count)                                TWOWORDINLINE(0x7004, 0xA05C);
  706.  
  707.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  708.                                                                                             #pragma parameter __D0 UnlockMemory(__A0, __A1)
  709.                                                                                             #endif
  710. EXTERN_API( OSErr )
  711. UnlockMemory                    (void *                    address,
  712.                                  unsigned long             count)                                TWOWORDINLINE(0x7003, 0xA05C);
  713.  
  714.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  715.                                                                                             #pragma parameter __D0 MakeMemoryResident(__A0, __A1)
  716.                                                                                             #endif
  717. EXTERN_API( OSErr )
  718. MakeMemoryResident                (void *                    address,
  719.                                  unsigned long             count)                                TWOWORDINLINE(0x700B, 0xA05C);
  720.  
  721.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  722.                                                                                             #pragma parameter __D0 ReleaseMemoryData(__A0, __A1)
  723.                                                                                             #endif
  724. EXTERN_API( OSErr )
  725. ReleaseMemoryData                (void *                    address,
  726.                                  unsigned long             count)                                TWOWORDINLINE(0x700C, 0xA05C);
  727.  
  728.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  729.                                                                                             #pragma parameter __D0 MakeMemoryNonResident(__A0, __A1)
  730.                                                                                             #endif
  731. EXTERN_API( OSErr )
  732. MakeMemoryNonResident            (void *                    address,
  733.                                  unsigned long             count)                                TWOWORDINLINE(0x700D, 0xA05C);
  734.  
  735.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  736.                                                                                             #pragma parameter __D0 FlushMemory(__A0, __A1)
  737.                                                                                             #endif
  738. EXTERN_API( OSErr )
  739. FlushMemory                        (void *                    address,
  740.                                  unsigned long             count)                                TWOWORDINLINE(0x700E, 0xA05C);
  741.  
  742. EXTERN_API( OSErr )
  743. GetPhysical                        (LogicalToPhysicalTable * addresses,
  744.                                  unsigned long *        physicalEntryCount);
  745.  
  746.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  747.                                                                                             #pragma parameter __D0 GetVolumeVirtualMemoryInfo(__A0)
  748.                                                                                             #endif
  749. EXTERN_API( OSErr )
  750. GetVolumeVirtualMemoryInfo        (VolumeVirtualMemoryInfoPtr  volVMInfo)                        TWOWORDINLINE(0x700F, 0xA05C);
  751.  
  752.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  753.                                                                                             #pragma parameter __D0 DeferUserFn(__A0, __D0)
  754.                                                                                             #endif
  755. EXTERN_API( OSErr )
  756. DeferUserFn                        (UserFnUPP                 userFunction,
  757.                                  void *                    argument)                            ONEWORDINLINE(0xA08F);
  758.  
  759.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  760.                                                                                             #pragma parameter __D0 DebuggerGetMax
  761.                                                                                             #endif
  762. EXTERN_API( long )
  763. DebuggerGetMax                    (void)                                                        TWOWORDINLINE(0x7000, 0xA08D);
  764.  
  765. EXTERN_API( void )
  766. DebuggerEnter                    (void)                                                        TWOWORDINLINE(0x7001, 0xA08D);
  767.  
  768. EXTERN_API( void )
  769. DebuggerExit                    (void)                                                        TWOWORDINLINE(0x7002, 0xA08D);
  770.  
  771. EXTERN_API( void )
  772. DebuggerPoll                    (void)                                                        TWOWORDINLINE(0x7003, 0xA08D);
  773.  
  774.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  775.                                                                                             #pragma parameter __D0 GetPageState(__A0)
  776.                                                                                             #endif
  777. EXTERN_API( PageState )
  778. GetPageState                    (const void *            address)                            TWOWORDINLINE(0x7004, 0xA08D);
  779.  
  780.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  781.                                                                                             #pragma parameter __D0 PageFaultFatal
  782.                                                                                             #endif
  783. EXTERN_API( Boolean )
  784. PageFaultFatal                    (void)                                                        TWOWORDINLINE(0x7005, 0xA08D);
  785.  
  786.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  787.                                                                                             #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
  788.                                                                                             #endif
  789. EXTERN_API( OSErr )
  790. DebuggerLockMemory                (void *                    address,
  791.                                  unsigned long             count)                                TWOWORDINLINE(0x7006, 0xA08D);
  792.  
  793.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  794.                                                                                             #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
  795.                                                                                             #endif
  796. EXTERN_API( OSErr )
  797. DebuggerUnlockMemory            (void *                    address,
  798.                                  unsigned long             count)                                TWOWORDINLINE(0x7007, 0xA08D);
  799.  
  800.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  801.                                                                                             #pragma parameter __D0 EnterSupervisorMode
  802.                                                                                             #endif
  803. EXTERN_API( StatusRegisterContents )
  804. EnterSupervisorMode                (void)                                                        TWOWORDINLINE(0x7008, 0xA08D);
  805.  
  806.  
  807. /* 
  808.     StripAddress is a trap on classic 68K and the
  809.     identity function on PowerMacs and other OS's.
  810. */
  811. #if TARGET_OS_MAC && TARGET_CPU_68K
  812.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  813.                                                                                             #pragma parameter __D0 StripAddress(__D0)
  814.                                                                                             #endif
  815. EXTERN_API( Ptr )
  816. StripAddress                    (void *                    theAddress)                            ONEWORDINLINE(0xA055);
  817.  
  818. #else
  819. #define StripAddress(x)       ((Ptr)(x))
  820. #endif
  821. /* 
  822.     Translate24To32 is a trap on classic 68K and the
  823.     identity function on PowerMacs and other OS's.
  824. */
  825. #if TARGET_OS_MAC && TARGET_CPU_68K
  826.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  827.                                                                                             #pragma parameter __D0 Translate24To32(__D0)
  828.                                                                                             #endif
  829. EXTERN_API( Ptr )
  830. Translate24To32                    (void *                    addr24)                                ONEWORDINLINE(0xA091);
  831.  
  832. #else
  833. #define Translate24To32(x)       ((Ptr)(x))
  834. #endif
  835. EXTERN_API( OSErr )
  836. HandToHand                        (Handle *                theHndl);
  837.  
  838.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  839.                                                                                             #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
  840.                                                                                             #endif
  841. EXTERN_API( OSErr )
  842. PtrToXHand                        (const void *            srcPtr,
  843.                                  Handle                 dstHndl,
  844.                                  long                     size)                                ONEWORDINLINE(0xA9E2);
  845.  
  846. EXTERN_API( OSErr )
  847. PtrToHand                        (const void *            srcPtr,
  848.                                  Handle *                dstHndl,
  849.                                  long                     size);
  850.  
  851.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  852.                                                                                             #pragma parameter __D0 HandAndHand(__A0, __A1)
  853.                                                                                             #endif
  854. EXTERN_API( OSErr )
  855. HandAndHand                        (Handle                 hand1,
  856.                                  Handle                 hand2)                                ONEWORDINLINE(0xA9E4);
  857.  
  858.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  859.                                                                                             #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
  860.                                                                                             #endif
  861. EXTERN_API( OSErr )
  862. PtrAndHand                        (const void *            ptr1,
  863.                                  Handle                 hand2,
  864.                                  long                     size)                                ONEWORDINLINE(0xA9EF);
  865.  
  866. /* Carbon routines to aid in debugging. */
  867. /* Checks all applicable heaps for validity */
  868. EXTERN_API( Boolean )
  869. CheckAllHeaps                    (void);
  870.  
  871. /* Checks the application heap for validity */
  872. EXTERN_API( Boolean )
  873. IsHeapValid                        (void);
  874.  
  875. /* It is invalid to pass a NULL or an empty Handle to IsHandleValid */
  876. EXTERN_API( Boolean )
  877. IsHandleValid                    (Handle                 h);
  878.  
  879. /* It is invalid to pass a NULL Pointer to IsPointerValid */
  880. EXTERN_API( Boolean )
  881. IsPointerValid                    (Ptr                     p);
  882.  
  883.  
  884. #if OLDROUTINENAMES
  885. #define ApplicZone() ApplicationZone()
  886. #define MFTempNewHandle(logicalSize, resultCode) TempNewHandle(logicalSize, resultCode)
  887. #define MFMaxMem(grow) TempMaxMem(grow)
  888. #define MFFreeMem() TempFreeMem()
  889. #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
  890. #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
  891. #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
  892. #define MFTopMem() TempTopMem()
  893. #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
  894. #define DisposPtr(p) DisposePtr(p)
  895. #define DisposHandle(h) DisposeHandle(h)
  896. #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
  897. #endif  /* OLDROUTINENAMES */
  898.  
  899.  
  900. #if PRAGMA_STRUCT_ALIGN
  901.     #pragma options align=reset
  902. #elif PRAGMA_STRUCT_PACKPUSH
  903.     #pragma pack(pop)
  904. #elif PRAGMA_STRUCT_PACK
  905.     #pragma pack()
  906. #endif
  907.  
  908. #ifdef PRAGMA_IMPORT_OFF
  909. #pragma import off
  910. #elif PRAGMA_IMPORT
  911. #pragma import reset
  912. #endif
  913.  
  914. #ifdef __cplusplus
  915. }
  916. #endif
  917.  
  918. #endif /* __MACMEMORY__ */
  919.  
  920.